package com.leadership.training.entity.dynamic.report;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.apache.commons.lang3.StringUtils;

/**
 * 事业部
 * 
 * @author Rockett
 *
 */
@Entity
@Table(name = "t_dynamic_report_data")
public class DynamicReportData {
    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private DynamicReport dynamicReport;
    
    
    private String col1;
    private String col2;
    private String col3;
    private String col4;
    private String col5;
    private String col6;
    private String col7;
    private String col8;
    private String col9;
    private String col10;
    private String col11;
    private String col12;
    private String col13;
    private String col14;
    private String col15;
    private String col16;
    private String col17;
    private String col18;
    private String col19;
    private String col20;
    private String col21;
    private String col22;
    private String col23;
    private String col24;
    private String col25;

    
    
    /**
     * 是否可用
     */
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /**
     * The default constructor
     */
    public DynamicReportData() {
    	this.disabled=false;
    }
    
 

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }


    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

	/**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }



	/**
	 * @return the dynamicReport
	 */
	public DynamicReport getDynamicReport() {
		return dynamicReport;
	}



	/**
	 * @param dynamicReport the dynamicReport to set
	 */
	public void setDynamicReport(DynamicReport dynamicReport) {
		this.dynamicReport = dynamicReport;
	}



	/**
	 * @return the col1
	 */
	public String getCol1() {
		return col1;
	}



	/**
	 * @param col1 the col1 to set
	 */
	public void setCol1(String col1) {
		this.col1 = col1;
	}



	/**
	 * @return the col2
	 */
	public String getCol2() {
		return col2;
	}



	/**
	 * @param col2 the col2 to set
	 */
	public void setCol2(String col2) {
		this.col2 = col2;
	}



	/**
	 * @return the col3
	 */
	public String getCol3() {
		return col3;
	}



	/**
	 * @param col3 the col3 to set
	 */
	public void setCol3(String col3) {
		this.col3 = col3;
	}



	/**
	 * @return the col4
	 */
	public String getCol4() {
		return col4;
	}



	/**
	 * @param col4 the col4 to set
	 */
	public void setCol4(String col4) {
		this.col4 = col4;
	}



	/**
	 * @return the col5
	 */
	public String getCol5() {
		return col5;
	}



	/**
	 * @param col5 the col5 to set
	 */
	public void setCol5(String col5) {
		this.col5 = col5;
	}



	/**
	 * @return the col6
	 */
	public String getCol6() {
		return col6;
	}



	/**
	 * @param col6 the col6 to set
	 */
	public void setCol6(String col6) {
		this.col6 = col6;
	}



	/**
	 * @return the col7
	 */
	public String getCol7() {
		return col7;
	}



	/**
	 * @param col7 the col7 to set
	 */
	public void setCol7(String col7) {
		this.col7 = col7;
	}



	/**
	 * @return the col8
	 */
	public String getCol8() {
		return col8;
	}



	/**
	 * @param col8 the col8 to set
	 */
	public void setCol8(String col8) {
		this.col8 = col8;
	}



	/**
	 * @return the col9
	 */
	public String getCol9() {
		return col9;
	}



	/**
	 * @param col9 the col9 to set
	 */
	public void setCol9(String col9) {
		this.col9 = col9;
	}



	/**
	 * @return the col1
	 */
	public String getCol10() {
		return col10;
	}



	/**
	 * @param col1 the col1 to set
	 */
	public void setCol10(String col10) {
		this.col10 = col10;
	}



	/**
	 * @return the col11
	 */
	public String getCol11() {
		return col11;
	}



	/**
	 * @param col11 the col11 to set
	 */
	public void setCol11(String col11) {
		this.col11 = col11;
	}



	/**
	 * @return the col12
	 */
	public String getCol12() {
		return col12;
	}



	/**
	 * @param col12 the col12 to set
	 */
	public void setCol12(String col12) {
		this.col12 = col12;
	}



	/**
	 * @return the col13
	 */
	public String getCol13() {
		return col13;
	}



	/**
	 * @param col13 the col13 to set
	 */
	public void setCol13(String col13) {
		this.col13 = col13;
	}



	/**
	 * @return the col14
	 */
	public String getCol14() {
		return col14;
	}



	/**
	 * @param col14 the col14 to set
	 */
	public void setCol14(String col14) {
		this.col14 = col14;
	}



	/**
	 * @return the col15
	 */
	public String getCol15() {
		return col15;
	}



	/**
	 * @param col15 the col15 to set
	 */
	public void setCol15(String col15) {
		this.col15 = col15;
	}



	/**
	 * @return the col16
	 */
	public String getCol16() {
		return col16;
	}



	/**
	 * @param col16 the col16 to set
	 */
	public void setCol16(String col16) {
		this.col16 = col16;
	}



	/**
	 * @return the col17
	 */
	public String getCol17() {
		return col17;
	}



	/**
	 * @param col17 the col17 to set
	 */
	public void setCol17(String col17) {
		this.col17 = col17;
	}



	/**
	 * @return the col18
	 */
	public String getCol18() {
		return col18;
	}



	/**
	 * @param col18 the col18 to set
	 */
	public void setCol18(String col18) {
		this.col18 = col18;
	}



	/**
	 * @return the col19
	 */
	public String getCol19() {
		return col19;
	}



	/**
	 * @param col19 the col19 to set
	 */
	public void setCol19(String col19) {
		this.col19 = col19;
	}



	/**
	 * @return the col2
	 */
	public String getCol20() {
		return col20;
	}



	/**
	 * @param col2 the col2 to set
	 */
	public void setCol20(String col20) {
		this.col20 = col20;
	}



	/**
	 * @return the col21
	 */
	public String getCol21() {
		return col21;
	}



	/**
	 * @param col21 the col21 to set
	 */
	public void setCol21(String col21) {
		this.col21 = col21;
	}



	/**
	 * @return the col22
	 */
	public String getCol22() {
		return col22;
	}



	/**
	 * @param col22 the col22 to set
	 */
	public void setCol22(String col22) {
		this.col22 = col22;
	}



	/**
	 * @return the col23
	 */
	public String getCol23() {
		return col23;
	}



	/**
	 * @param col23 the col23 to set
	 */
	public void setCol23(String col23) {
		this.col23 = col23;
	}



	/**
	 * @return the col24
	 */
	public String getCol24() {
		return col24;
	}



	/**
	 * @param col24 the col24 to set
	 */
	public void setCol24(String col24) {
		this.col24 = col24;
	}



	/**
	 * @return the col25
	 */
	public String getCol25() {
		return col25;
	}



	/**
	 * @param col25 the col25 to set
	 */
	public void setCol25(String col25) {
		this.col25 = col25;
	}

	public Object[] getDataToObj(){
		return new Object[]{
				this.col1,
				this.col2,
				this.col3,
				this.col4,
				this.col5,
				this.col6,
				this.col7,
				this.col8,
				this.col9,
				this.col10,
				this.col11,
				this.col12,
				this.col13,
				this.col14,
				this.col15,
				this.col16,
				this.col17,
				this.col18,
				this.col19,
				this.col20,
				this.col21,
				this.col22,
				this.col23,
				this.col24,
				this.col25
		};
	}
	
	public String[] getColValues(){
		return new String[]{
				this.col1,
				this.col2,
				this.col3,
				this.col4,
				this.col5,
				this.col6,
				this.col7,
				this.col8,
				this.col9,
				this.col10,
				this.col11,
				this.col12,
				this.col13,
				this.col14,
				this.col15,
				this.col16,
				this.col17,
				this.col18,
				this.col19,
				this.col20,
				this.col21,
				this.col22,
				this.col23,
				this.col24,
				this.col25
		};
		
	}
	/**
	 * 获取指定列的值
	 * @param idx
	 * @return
	 */
	public String getColValue(int idx){
		switch(idx) {
		case  0:  	return this.col1;
		case  1:	return this.col2;
		case  2:	return this.col3;
		case  3:	return this.col4;
		case  4:	return this.col5;
		case  5:	return this.col6;
		case  6:	return this.col7;
		case  7:	return this.col8;
		case  8:	return this.col9;
		case  9:	return this.col10;
		case  10:	return this.col11;
		case  11:	return this.col12;
		case  12:	return this.col13;
		case  13:	return this.col14;
		case  14:	return this.col15;
		case  15:	return this.col16;
		case  16:	return this.col17;
		case  17:	return this.col18;
		case  18:	return this.col19;
		case  19:	return this.col20;
		case  20:	return this.col21;
		case  21:	return this.col22;
		case  22:	return this.col23;
		case  23:	return this.col24;
		case  24:	return this.col25;
		default: return "";
		}

	}
	/**
	 * set value to specified column
	 * @param idx
	 * @param value
	 */
	public void setColValue(int idx, String value){
		switch(idx) {
		case  0:  this.col1=value; break;
		case  1:  this.col2=value; break;
		case  2:  this.col3=value; break;
		case  3:  this.col4=value; break;
		case  4:  this.col5=value; break;
		case  5:  this.col6=value; break;
		case  6:  this.col7=value; break;
		case  7:  this.col8=value; break;
		case  8:  this.col9=value; break;
		case  9:  this.col10=value; break;
		case  10: this.col11=value; break;
		case  11: this.col12=value; break;
		case  12: this.col13=value; break;
		case  13: this.col14=value; break;
		case  14: this.col15=value; break;
		case  15: this.col16=value; break;
		case  16: this.col17=value; break;
		case  17: this.col18=value; break;
		case  18: this.col19=value; break;
		case  19: this.col20=value; break;
		case  20: this.col21=value; break;
		case  21: this.col22=value; break;
		case  22: this.col23=value; break;
		case  23: this.col24=value; break;
		case  24: this.col25=value; break;
		}
		
	}
	/**
	 * if input value is empty then ignore the whole object
	 * @return
	 */
	public boolean isEmpty(){
		if(!StringUtils.isBlank(this.col1)) return false;
		if(!StringUtils.isBlank(this.col2)) return false;
		if(!StringUtils.isBlank(this.col3)) return false;
		if(!StringUtils.isBlank(this.col4)) return false;
		if(!StringUtils.isBlank(this.col5)) return false;
		if(!StringUtils.isBlank(this.col6)) return false;
		if(!StringUtils.isBlank(this.col7)) return false;
		if(!StringUtils.isBlank(this.col8)) return false;
		if(!StringUtils.isBlank(this.col9)) return false;
		if(!StringUtils.isBlank(this.col10)) return false;
		if(!StringUtils.isBlank(this.col11)) return false;
		if(!StringUtils.isBlank(this.col12)) return false;
		if(!StringUtils.isBlank(this.col13)) return false;
		if(!StringUtils.isBlank(this.col14)) return false;
		if(!StringUtils.isBlank(this.col15)) return false;
		if(!StringUtils.isBlank(this.col16)) return false;
		if(!StringUtils.isBlank(this.col17)) return false;
		if(!StringUtils.isBlank(this.col18)) return false;
		if(!StringUtils.isBlank(this.col19)) return false;
		if(!StringUtils.isBlank(this.col20)) return false;
		if(!StringUtils.isBlank(this.col21)) return false;
		if(!StringUtils.isBlank(this.col22)) return false;
		if(!StringUtils.isBlank(this.col23)) return false;
		if(!StringUtils.isBlank(this.col24)) return false;
		if(!StringUtils.isBlank(this.col25)) return false;
		return true;
	}
}